#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)
#include<stdio.h>
int removeElement(int* nums, int numsSize, int val) {
    int i = 0;
    int count = 0;
    int* temp = nums;
    while (temp < nums + numsSize)
    {
        if (*temp != val)
        {
            nums[i] = *temp;
            i++;
            count++;
        }
        temp++;
    }
    for (int n = count; n < numsSize; n++)
    {
        nums[n] = val;
    }
    return i;
}
int main()
{
    int nums[] = { 3,2,2,3 };
    int val = 3;
    int numsSize = sizeof(nums) / sizeof(nums[0]);
    printf("%d", removeElement(nums, numsSize, val));
	return 0;
}
